﻿package frEngine.loaders.away3dMd5
{
    import flash.utils.*;

    public class MD5SubAnimParser extends MD5AnimParserBase
    {

        public function MD5SubAnimParser(param1:String, param2:MD5AnimByteArrayParser, param3:ByteArray, param4:SkeletonClipNode)
        {
            super(param1);
            _bytes = param3;
            baseFrameData = param2.baseFrameData;
            hierarchy = param2.hierarchy;
            _numAnimatedComponents = param2.headAndJoins.numAnimatedComponents;
            _numJoints = param2.headAndJoins.numJoints;
            this.getClipList(param2.animationSet);
            this.setClip(param4);
            return;
        }// end function

        private function getClipList(param1:SkeletonAnimationSet) : void
        {
            _bytes.endian = Endian.LITTLE_ENDIAN;
            _bytes.position = 0;
            var _loc_2:* = _bytes.readUnsignedShort();
            var _loc_3:* = _bytes.readUnsignedShort();
            var _loc_4:* = MD5AnimParserBase.checkIsCompressBone(_loc_2, _loc_3);
            if (_loc_4)
            {
                _bytes.position = 0;
                _bytes.uncompress();
                _loc_2 = _bytes.readUnsignedShort();
                _loc_3 = _bytes.readUnsignedShort();
            }
            return;
        }// end function

    }
}
